package com.ruoyi.work.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.work.mapper.WorkCompanyBankMapper;
import com.ruoyi.work.domain.WorkCompanyBank;
import com.ruoyi.work.service.IWorkCompanyBankService;
import com.ruoyi.common.core.text.Convert;

/**
 * 公司账号Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-12-21
 */
@Service
public class WorkCompanyBankServiceImpl implements IWorkCompanyBankService 
{
    @Autowired
    private WorkCompanyBankMapper workCompanyBankMapper;

    /**
     * 查询公司账号
     * 
     * @param companyId 公司账号主键
     * @return 公司账号
     */
    @Override
    public WorkCompanyBank selectWorkCompanyBankByCompanyId(Long companyId)
    {
        return workCompanyBankMapper.selectWorkCompanyBankByCompanyId(companyId);
    }

    /**
     * 查询公司账号列表
     * 
     * @param workCompanyBank 公司账号
     * @return 公司账号
     */
    @Override
    public List<WorkCompanyBank> selectWorkCompanyBankList(WorkCompanyBank workCompanyBank)
    {
        return workCompanyBankMapper.selectWorkCompanyBankList(workCompanyBank);
    }

    /**
     * 新增公司账号
     * 
     * @param workCompanyBank 公司账号
     * @return 结果
     */
    @Override
    public int insertWorkCompanyBank(WorkCompanyBank workCompanyBank)
    {
        workCompanyBank.setCreateTime(DateUtils.getNowDate());
        return workCompanyBankMapper.insertWorkCompanyBank(workCompanyBank);
    }

    /**
     * 修改公司账号
     * 
     * @param workCompanyBank 公司账号
     * @return 结果
     */
    @Override
    public int updateWorkCompanyBank(WorkCompanyBank workCompanyBank)
    {
        workCompanyBank.setUpdateTime(DateUtils.getNowDate());
        return workCompanyBankMapper.updateWorkCompanyBank(workCompanyBank);
    }

    /**
     * 批量删除公司账号
     * 
     * @param companyIds 需要删除的公司账号主键
     * @return 结果
     */
    @Override
    public int deleteWorkCompanyBankByCompanyIds(String companyIds)
    {
        return workCompanyBankMapper.deleteWorkCompanyBankByCompanyIds(Convert.toStrArray(companyIds));
    }

    /**
     * 删除公司账号信息
     * 
     * @param companyId 公司账号主键
     * @return 结果
     */
    @Override
    public int deleteWorkCompanyBankByCompanyId(Long companyId)
    {
        return workCompanyBankMapper.deleteWorkCompanyBankByCompanyId(companyId);
    }
}
